From 53451bc0cb13f782b465968cd2286514d0fe95b7 Mon Sep 17 00:00:00 2001 From: "awilliam@xenbuild.aw" Date: Fri, 7 Apr 2006 11:40:33 -0600 Subject: [PATCH] [IA64] MAX_VIRT_CPUS and NR_CPUS Increase MAX_VIRT_CPUS and NR_CPUS to 64. Check maxcpus < MAX_VIRT_CPUS. Check size of shared_info (<= PAGE_SIZE). Signed-off-by: Tristan Gingold --- xen/arch/ia64/asm-offsets.c | 1 + xen/arch/ia64/xen/xensetup.c | 12 ++++++++++++ xen/include/asm-ia64/config.h | 19 ++----------------- xen/include/public/arch-ia64.h | 2 +- 4 files changed, 16 insertions(+), 18 deletions(-) diff --git a/xen/arch/ia64/asm-offsets.c b/xen/arch/ia64/asm-offsets.c index ee4148d1f0..0bc2463dfc 100644 --- a/xen/arch/ia64/asm-offsets.c +++ b/xen/arch/ia64/asm-offsets.c @@ -30,6 +30,7 @@ void foo(void) DEFINE(IA64_SWITCH_STACK_SIZE, sizeof (struct switch_stack)); DEFINE(IA64_CPU_SIZE, sizeof (struct cpuinfo_ia64)); DEFINE(UNW_FRAME_INFO_SIZE, sizeof (struct unw_frame_info)); + DEFINE(SHARED_INFO_SIZE, sizeof (struct shared_info)); BLANK(); #ifdef VTI_DEBUG diff --git a/xen/arch/ia64/xen/xensetup.c b/xen/arch/ia64/xen/xensetup.c index 00e7bb8079..0a9e4132be 100644 --- a/xen/arch/ia64/xen/xensetup.c +++ b/xen/arch/ia64/xen/xensetup.c @@ -24,6 +24,12 @@ #include #include +/* Be sure the struct shared_info fits on a page because it is mapped in + domain. */ +#if SHARED_INFO_SIZE > PAGE_SIZE + #error "struct shared_info does not not fit in PAGE_SIZE" +#endif + unsigned long xenheap_phys_end; char saved_command_line[COMMAND_LINE_SIZE]; @@ -321,7 +327,13 @@ printk("About to call timer_init()\n"); //boot_cpu_data.x86_num_cores = 1; } + /* A vcpu is created for the idle domain on every physical cpu. + Limit the number of cpus to the maximum number of vcpus. */ + if (max_cpus > MAX_VIRT_CPUS) + max_cpus = MAX_VIRT_CPUS; + smp_prepare_cpus(max_cpus); + /* We aren't hotplug-capable yet. */ for_each_cpu ( i ) cpu_set(i, cpu_present_map); diff --git a/xen/include/asm-ia64/config.h b/xen/include/asm-ia64/config.h index dad2335f38..4d3437b450 100644 --- a/xen/include/asm-ia64/config.h +++ b/xen/include/asm-ia64/config.h @@ -25,17 +25,12 @@ #ifdef CONFIG_XEN_SMP #define CONFIG_SMP 1 -#define NR_CPUS 8 -#define CONFIG_NR_CPUS 8 +#define NR_CPUS 64 #else #undef CONFIG_SMP #define NR_CPUS 1 -#define CONFIG_NR_CPUS 1 #endif -//#define NR_CPUS 16 -//#define CONFIG_NR_CPUS 16 -//leave SMP for a later time -//#undef CONFIG_SMP +#define CONFIG_NR_CPUS NR_CPUS #define supervisor_mode_kernel (0) @@ -121,9 +116,6 @@ extern char _end[]; /* standard ELF symbol */ #define CMPXCHG_BUGCHECK_DECL // from include/asm-ia64/smp.h -#ifdef CONFIG_SMP -//#warning "Lots of things to fix to enable CONFIG_SMP!" -#endif #define get_cpu() smp_processor_id() #define put_cpu() do {} while(0) @@ -284,13 +276,6 @@ extern int ht_per_core; #endif /* __ASSEMBLY__ */ #endif /* __XEN_IA64_CONFIG_H__ */ -// needed for include/xen/smp.h -//#ifdef CONFIG_SMP -//#define raw_smp_processor_id() current->processor -//#else -//#define raw_smp_processor_id() 0 -//#endif - #ifndef __ASSEMBLY__ #include #define FORCE_CRASH() asm("break.m 0;;"); diff --git a/xen/include/public/arch-ia64.h b/xen/include/public/arch-ia64.h index 45e857321b..91f674b16a 100644 --- a/xen/include/public/arch-ia64.h +++ b/xen/include/public/arch-ia64.h @@ -31,7 +31,7 @@ DEFINE_GUEST_HANDLE(void); /* Maximum number of virtual CPUs in multi-processor guests. */ /* WARNING: before changing this, check that shared_info fits on a page */ -#define MAX_VIRT_CPUS 4 +#define MAX_VIRT_CPUS 64 #ifndef __ASSEMBLY__ -- 2.30.2